﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
using App1AppHandler;

namespace Reborn_WorldServer.App1AppHandler
{
    //This subclass simply adds a value to store the characters number of available combines they can do
    //with their current inventory.
    public class RecipieData : Recipie
    {
        public int avail;

        public override void copyFrom(Recipie copyFromRecipie)
        {
            base.copyFrom(copyFromRecipie);

            //Change the RecipieItem to RecipieItemData for requiredItems
            for (int x = 0; x < requiredItems.Count; x++)
            {
                RecipieItemData ri = new RecipieItemData();
                ri.copyFrom(requiredItems[x]);

                requiredItems[x] = ri;
            }
        }

        public override void writeXmlAttributes(XmlTextWriter xmldoc, Character sendingToCharacter)
        {
            base.writeXmlAttributes(xmldoc, sendingToCharacter);

            xmldoc.WriteAttributeString("avail", avail.ToString());
        }
        public override void writeXmlElements(XmlTextWriter xmldoc, Character sendingToCharacter)
        {
            //No additions to this subclass just run base
            base.writeXmlElements(xmldoc, sendingToCharacter);
        }
        
    }
}
